<?php
session_start();
$link = mysql_connect("localhost", "rene_fotoclub", "kroog")
or die("Keine Verbindung moeglich: " . mysql_error());
mysql_select_db("rene_fotoclub") or die("Auswahl der Datenbank fehlgeschlagen");
$resultuser = mysql_query("SELECT * from user order by name") or die("Error on executing query: " . mysql_error());
$cntuser = mysql_num_rows($resultuser);

$i = $cntuser;

while ($row = mysql_fetch_assoc($resultuser)) {
	$i--;
	$flickrids .= $row['flickrid'];
	if($i>0)
	$flickrids .= ",";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Fotoclub - Collectors Item</title>

<!-- Meta Tags -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Fotoclub - Collectors Item" />
<meta name="description" content="" />

<!-- CSS -->
<link rel="stylesheet" href="dijit/themes/tundra/tundra.css"
	type="text/css" media="all" />

<style type="text/css">
@import "/dojox/grid/resources/Grid.css";

@import "/dojox/grid/resources/tundraGrid.css";

.dojoxGrid table {
	margin: 0;
}
</style>
<style type="text/css">
body,html {
	font-family: helvetica, arial, sans-serif;
	font-size: 90%;
}
</style>
<style type="text/css">
html,body {
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

#borderContainer {
	width: 100%;
	height: 100%;
}
</style>
<body class="tundra">
<script type="text/javascript" sr src="/dojo/dojo.js"
	djConfig="parseOnLoad: true"></script>
<?php

if(isset($_POST['user']) && $_REQUEST['func'] == "login"){
	session_register('user');
	$_SESSION['user'] = $_POST['user'];
}
if($_REQUEST['func'] == "logout"){
	session_destroy();
	session_unregister('user');
}

if(!isset($_SESSION['user']) || $_REQUEST['func'] == "logout"){
	require_once("templates/login.tpl");
}else{
	require_once("templates/content.tpl");
}
?>
</body>

</html>
